﻿using System;

class PropertyChangedEventArgs : EventArgs
{
    private string propertyName;
    private object oldValue;
    private object newValue;

    public string PropertyName
    {
        get
        {
            return propertyName;
        }
        set
        {
            if (value != null && value != "")
            {
                propertyName = value;
            }
            else
            {
                throw new ArgumentOutOfRangeException("Invalid name {0}.", value);
            }

        }
    }
    public object NewValue
    {
        get
        {
            return newValue;
        }
        set
        {
            if (value != null)
            {
                newValue = value;
            }
            else
            {
                throw new NullReferenceException("Null reference for New Value.");
            }

        }
    }
    public object OldValue
    {
        get
        {
            return oldValue;
        }
        set
        {
            if (value != null)
            {
                oldValue = value;
            }
            else
            {
                throw new NullReferenceException("Null reference for Old Value.");
            }
        }
    }

    public PropertyChangedEventArgs(string propertyName, object oldValue, object newValue)
    {
        this.PropertyName = propertyName;
        this.OldValue = oldValue;
        this.NewValue = newValue;
    }
}

